package mk.com.ldm.corepoint.administration.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */

public class Core implements EntryPoint {
	
	public void onModuleLoad() {
		RootPanel.get("center").setHeight(Window.getClientHeight()+"px");
		CoreServiceAsync rpcService = GWT.create(CoreService.class);
	    HandlerManager eventBus = new HandlerManager(null);
	    final AppController appViewer = new AppController(rpcService, eventBus);
	
	    Timer t = new Timer(){

			@Override
			public void run() {
				DOM.getElementById("center").setInnerHTML("");
				appViewer.go(RootPanel.get("center"));
			}
	    	
	    };
	    
	    t.schedule(3000);
		
	}
}
